import http from '@/utils/request';

// 获取默认收获地址
export const getDefault = () => {
	return http.request({
		method: 'GET',
		url: '/mall-user/app/address/default',
		custom: {
			loading: false,
		},
	});
};
export const getPage = (params: object) => {
	return http.request({
		method: 'GET',
		url: '/mall-user/app/address/page',
		params,
	});
};
//新增/编辑用户收货地址
export const saveOrUpdateAddress = (data: object) => {
	return http.request({
		method: 'POST',
		url: '/mall-user/app/address',
		data,
	});
};
export const getById = (id: string) => {
	return http.request({
		method: 'GET',
		url: '/mall-user/app/address/' + id,
	});
};
export const delAddress = (id: string) => {
	return http.request({
		method: 'DELETE',
		url: '/mall-user/app/address/' + id,
	});
};
